<?php

function ComboBox($Tipo, $Nome, $Valor, $PodeSerNull = false)
{
    require_once 'Listas.php';
    $Itens = ObterItens($Tipo);
    ?>

    <div class="input-control select">
        <select name="<?php echo $Nome; ?>">
            <?php
            if ($PodeSerNull)
            {
                ?>
                <option value=""></option>            
                <?php
            }
            if ($Itens != null)
            {
                foreach (array_keys($Itens) as $item)
                {
                    ?>
                    <option value="<?php echo $item; ?>" <?php echo $Valor == $item ? "Selected" : ""; ?>>
                        <?php echo $Itens[$item]; ?>
                    </option>            
                    <?php
                }
            }
            ?>

        </select>
    </div>
    <?php
}
?>
